<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSmsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sms', function (Blueprint $table) {
            $table->increments('id');
            $table->string('mobile', 16)->default('')->comment('手机号');
            $table->string('content')->default('')->comment('短信内容');
            $table->boolean('state')->default(0)->comment('状态 -1:失败 0:待发送 1:成功');
            $table->timestamp('sent_at')->nullable()->comment('发送时间');
            $table->boolean('num')->default(0)->comment('计费条数');
            $table->decimal('fee', 3, 2)->default(0)->comment('计费总额');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sms');
    }
}
